<?php

include('input.php');
include('connect.php');

$content = $_POST['content'];
$user = $_POST['user'];

$input = new input();

// 调用函数，检查留言内容
$is = $input->post($content);
if( $is == false){
	die('留言内容的数据不正确');
}

$is = $input->post($user);
if( $is == false){
	die('留言内容的数据不正确');
}

$intime = time();
$sql = "INSERT INTO msgform (content, user, intime) values ('{$content}', '{$user}', '{$intime}')";

$is = $db->query($sql);
header("location: gbook.php");
?>